package com.hui.operatelog.dao;

import com.hui.auth.dao.sql.CommonSQLProvider;
import com.hui.operatelog.entity.OperateLog;
import com.hui.operatelog.vo.PageVo;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface OperateLogDao {

    /**
     * insert操作日志
     */
    @InsertProvider(type = CommonSQLProvider.class, method = "insert")
    @Options(useGeneratedKeys = true)
    boolean insert(OperateLog log);

    @Select("SELECT * FROM operate_log")
    List<OperateLog> list(PageVo params);

    @Delete("DELETE FROM operate_log WHERE id = #{logId}")
    void delete(Integer logId);
}
